<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        window.onload = function () {
            //使用js代码创建html标签，并显示在页面上
            //标签的内容就是：<div>牛逼<div>
            var divObj = document.createElement("div");
            divObj.innerHTML = "牛逼";//还只是在内存中
            let text = document.createTextNode("牛掰");
            divObj.append(text);
            //添加子元素
            document.body.appendChild(divObj);
        };
    </script>
</head>
<body>

</body>
</html>